import time
from utils.goods import get_categories
from apps.contents.models import ContentCategory
def generic_meiduo_index():
    categories = get_categories()
    contents = {}
    content_categories = ContentCategory.objects.all()
    for cat in content_categories:
        contents[cat.key] = cat.content_set.filter(status=True).order_by('sequence')
    context = {
        'categories': categories,
        'contents': contents,
    }
    from django.template import loader
    index_template=loader.get_template('index.html').render(context)
    with open('../../../front_end_pc/index.html','w',encoding='utf-8') as f:
        f.write(index_template)